package school.valon.constantes;

import school.valon.dto.CommentTypeDto;

public enum EnumCommentType {
	STUDENT_PERFORMANCE(1, "student performance"), COMPLAINT_ON_STAFF(2, "complaint on staff");

	private int typeId;
	private String caption;
	private EnumCommentType(int typeId, String caption) {
		this.typeId = typeId;
		this.caption = caption;
	}

	public int getTypeId() {
		return this.typeId;
	}
	public String getCaption() {
		return this.caption;
	}

	public static EnumCommentType getComentTypeById(int typeId) {
		for(EnumCommentType enumTypeIt : EnumCommentType.values()) {
			if (enumTypeIt.typeId == typeId) {
				return enumTypeIt;
			}
		}
		return null;
	}

	public CommentTypeDto getCommentTypeDto() {
		CommentTypeDto commentTypeDto = new CommentTypeDto();
		commentTypeDto.setCommentTypeId(this.typeId);
		return commentTypeDto;
	}
}
